package com.smartens.boit;

import android.app.Application;
import android.content.pm.ActivityInfo;
import android.util.Log;

import androidx.lifecycle.MutableLiveData;

import com.smartens.boit.bean.ControlBean;
import com.smartens.boit.bean.ProcessedBean;

import java.util.ArrayList;
import java.util.List;

public class MyApplication2 extends Application {
    public int faultCount=0;
    public static class timeData {
        String startTime;
        String endTime;
        public String getStartTime() {
            return startTime;
        }

        public void setStartTime(String startTime) {
            this.startTime = startTime;
        }

        public String getEndTime() {
            return endTime;
        }

        public void setEndTime(String endTime) {
            this.endTime = endTime;
        }
    }

    private final MutableLiveData<List<ControlBean>> listMutable = new MutableLiveData<>();
    private final MutableLiveData<Boolean> isShoudong = new MutableLiveData();

    public MutableLiveData<Boolean> getIsShoudong() {
        return isShoudong;
    }

    //public  boolean check=true;
    public List<ProcessedBean> beanList = new ArrayList<>();
    public boolean isControl = false;

    private void initdata() {
        List<ControlBean> list = new ArrayList<>();
        ControlBean controlBean = new ControlBean();
        ControlBean controlBean1 = new ControlBean();
        controlBean.setLight(100);
        controlBean.setName("开启组一设备");
        controlBean1.setLight(100);
        controlBean1.setName("开启组二设备");
        list.add(controlBean);
        list.add(controlBean1);
        isShoudong.setValue(true);
        listMutable.setValue(list);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        initdata();
    }

    public MutableLiveData<List<ControlBean>> getListMutable() {
        return listMutable;
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        Log.v("生命周期","applicationonTerminate");
    }
    public  void finishApp()
    {
         faultCount=0;
    }
}
